﻿using System.Collections.Generic;
using Model;
using DBUtility;

/*
 * 作者:陈杰
 * QQ  :710782046
 * Email:ovenjackchain@gmail.com
 * Web :http://www.qidian10.com
 */
namespace DAO
{
    public class d90_ybb_glzxDao
    {
        /// <summary>
        /// 获得所有记录
        /// </summary>
        /// <returns>返回所有记录IList</returns>
        public IList<d90_ybb_glzx> FindAll_d90_ybb_glzx()
        {
            return Common<d90_ybb_glzx>.Dt2List(DbHelperSQL.FindByConditions(new d90_ybb_glzx(), ""));
        }
        /// <summary>
        /// 分页获取数据
        /// </summary>
        /// <param name="start">起始记录号</param>
        /// <param name="limit">每页记录数</param>
        /// <param name="conditions">查询条件</param>
        /// <returns>返回符合记录的当前页数据</returns>
        public IList<d90_ybb_glzx> FindAllByPage_d90_ybb_glzx(string start, string limit, string conditions)
        {
            return Common<d90_ybb_glzx>.Dt2List(DbHelperSQL.FindByPage(new d90_ybb_glzx(), start, limit, conditions));
        }

        /// <summary>
        /// 查找符合条件记录的总条数
        /// </summary>
        /// <param name="conditions">查询条件</param>
        /// <returns>返回符合的记录条数</returns>
        public string GetCount_d90_ybb_glzx(string conditions)
        {
            return DbHelperSQL.GetCountByConditions(new d90_ybb_glzx(), conditions);
        }

        /// <summary>
        /// 根据id查找相应的一条记录
        /// </summary>
        /// <param name="id">要查找的ID号</param>
        /// <returns>返回值</returns>
        public d90_ybb_glzx FindById_d90_ybb_glzx(int id)
        {
            d90_ybb_glzx model = new d90_ybb_glzx();
            return Common<d90_ybb_glzx>.Dt2Model(model, DbHelperSQL.FindByConditions(model, " " + Common<object>.GetModelInfo(model)[1] + "=" + id.ToString()));
        }

        /// <summary>
        /// 添加新纪录
        /// </summary>
        /// <param name="d90_ybb_glzx">实体</param>
        /// <returns>返回是否成功</returns>
        public bool Add_d90_ybb_glzx(d90_ybb_glzx _d90_ybb_glzx)
        {
                return DbHelperSQL.Insert(_d90_ybb_glzx);
        }

        /// <summary>
        /// 更新对象
        /// </summary>
        /// <param name="d90_ybb_glzx">实体</param>
        /// <returns>返回是否成功</returns>
        public bool Update_d90_ybb_glzx(d90_ybb_glzx _d90_ybb_glzx)
        {
                return DbHelperSQL.Update(_d90_ybb_glzx);
        }
        //批量更新
        public bool Update_d90_ybb_glzx(string sets,string conditions)
        {
                return DbHelperSQL.Update(new d90_ybb_glzx(),sets,conditions);
        }
        /// <summary>
        /// 删除记录
        /// </summary>
        /// <param name="d90_ybb_glzx">实体</param>
        /// <returns>返回是否成功</returns>
        public bool Del_d90_ybb_glzx(d90_ybb_glzx _d90_ybb_glzx)
        {
                return DbHelperSQL.Delete(_d90_ybb_glzx);
        }
        //批量删除
        public bool Del_d90_ybb_glzx(string conditions)
        {
                return DbHelperSQL.Delete(new d90_ybb_glzx(),conditions);
        }
        /// <summary>
        /// 根据条件查询记录
        /// </summary>
        /// <param name="conditions">条件</param>
        /// <returns>返回符合条件的IList</returns>
        public IList<d90_ybb_glzx> FindByCondition_d90_ybb_glzx(string conditions)
        {
            return Common<d90_ybb_glzx>.Dt2List(DbHelperSQL.FindByConditions(new d90_ybb_glzx(), conditions));
        }
    }
}
